package com.ideal.service.impl;

import java.util.List;

import com.ideal.common.service.interf.IFirstIdealCommonService;
import com.ideal.common.service.interf.RMIObject;
import com.ideal.dao.interf.FirstIdealDaoInterface;
import com.ideal.utility.cache.DelegateMemcache;

/**
 * @ClassName: FirstIdealCommonImpl
 * @Description: TODO
 * @author yq
 * @date 2013��8��4�� ����9:29:50
 *
 */

public class FirstIdealCommonServiceImpl implements IFirstIdealCommonService{

	private DelegateMemcache cache;

	private FirstIdealDaoInterface firstIdealDaoImpl;

	public String firstHessianServicesRMI() throws Exception {
		// TODO Auto-generated method stub
		System.out.println("This first rmi to service by hessian.....");
		System.out.println(cache.getCache());
		return null;
	}

	/* (�� Javadoc)
	* <p>Title: rmiObject</p>
	* <p>Description: </p>
	* @param rmiObject
	* @return
	* @throws Exception
	* @see com.ideal.common.service.interf.IFirstIdealCommonService#rmiObject(com.ideal.common.service.interf.RMIObject)
	*/


	public RMIObject rmiObject(RMIObject rmiObject) throws Exception {
		// TODO Auto-generated method stub
		System.out.println(rmiObject.getName());
		RMIObject object = new RMIObject();
		this.cache.getCache().set("test_one_cache", "1231231231");

		List list = (List) firstIdealDaoImpl.selectFirstIdeal();

		object.setName("web");
		System.out.println(this.cache.getCache().get("test_one_cache"));
		return object;
	}

	public DelegateMemcache getCache() {
		return cache;
	}

	public void setCache(DelegateMemcache cache) {
		this.cache = cache;
	}

	public FirstIdealDaoInterface getFirstIdealDaoImpl() {
		return firstIdealDaoImpl;
	}

	public void setFirstIdealDaoImpl(FirstIdealDaoInterface firstIdealDaoImpl) {
		this.firstIdealDaoImpl = firstIdealDaoImpl;
	}

}
